from django.conf.urls import url
from django.urls import include
from rest_framework.routers import DefaultRouter
from .apis import (MaterialViewSet, UserViewSet, SupplyerViewSet, ProcessorViewSet, WorkShopViewSet,
                   ReceiveRecordsViewSet, RepertoryRecordsViewSet, PayRecordsViewSet, BuyRecordsViewSet,
                   ReturnGoodsRecordsViewSet)
from .views import Hello

router = DefaultRouter()
router.register(r'material', MaterialViewSet, basename='api-material')
router.register(r'user', UserViewSet, basename='api-user')
router.register(r'supplyer', SupplyerViewSet, basename='api-supplyer')
router.register(r'processor', ProcessorViewSet, basename='api-processor')
router.register(r'workshop', WorkShopViewSet, basename='api-workshop')
router.register(r'receiverecords', ReceiveRecordsViewSet, basename='api-receiverecords')
router.register(r'repertoryrecords', RepertoryRecordsViewSet, basename='api-repertoryrecords')
router.register(r'payrecords', PayRecordsViewSet, basename='api-payrecords')
router.register(r'buyrecords', BuyRecordsViewSet, basename='api-buyrecords')
router.register(r'returngoodsrecords', ReturnGoodsRecordsViewSet, basename='api-returngoodsrecords')
urlpatterns = [

    url(r'^api/', include((router.urls, 'api'), 'api')),
    url(r'', Hello.as_view(), name='hello'),

]
